package w83b.w83bOperacionesPaso.w83bComun;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import w83b.w83bUtilidadesComunes.W83bClsConstantes;

import es.ejie.frmk.presentacion.operacion.paso.Q70ActionPasoOP;
import es.ejie.frmk.presentacion.sesiondatos.Q70ContextoEJIE;

// TODO: Auto-generated Javadoc
/**
 * The Class W83bAccesoAplicacionOPAction.java.
 *
 * @author Deusto Sistemas
 */
public class W83bCambiarIdiomaOPAction extends Q70ActionPasoOP{

	
	/**
	 * processOP
	 * @param contexto a
	 * @param mapping a
	 * @param errores a
	 * @param form a
	 * @param request a
	 * @param response a
	 * @throws Exception e
	 */	
	protected void processOP(Q70ContextoEJIE contexto, ActionErrors errores, ActionMapping mapping,
			ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		
		contexto.set(W83bClsConstantes.CONSTANTE_CONTEXTO_IDIOMA, 
				(W83bClsConstantes.CONSTANTE_CASTELLANO.equals((String)contexto.get(W83bClsConstantes.CONSTANTE_CONTEXTO_IDIOMA)))
				? W83bClsConstantes.CONSTANTE_EUSKARA
                : W83bClsConstantes.CONSTANTE_CASTELLANO);
	}

	/**
	 * processForward
	 * @param contexto a
	 * @param mapping a
	 * @param errors a
	 * @param form a
	 * @param request a
	 * @param response a
	 * @throws Exception e
	 * @return ActionForward
	 */	
	protected ActionForward processForward(Q70ContextoEJIE contexto, ActionErrors errors, ActionMapping mapping, 
			ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
			
		return mapping.findForward("ok");
	}

}
